//
//  HMSegmentedControl.h
//  HMSegmentedControl
//
//  Created by Hesham Abd-Elmegid on 23/12/12.
//  Copyright (c) 2012 Hesham Abd-Elmegid. All rights reserved.
//

#import <UIKit/UIKit.h>

enum HMSelectionIndicatorMode {
    HMSelectionIndicatorResizesToStringWidth = 0, // Indicator width will only be as big as the text width
    HMSelectionIndicatorFillsSegment = 1 // Indicator width will fill the whole segment
};

@interface HMSegmentedControl : UIControl
{
    NSArray *sectionTitleArr;
    
    UIFont *font;
    UIColor *textColor;
    UIColor *backgroundColor;
    UIColor *separateLineColor;
    UIColor *selectionIndicatorColor;
    
    CGFloat height;
    CGFloat separateLineHeight;
    CGFloat selectionIndicatorHeight;
    
    enum HMSelectionIndicatorMode selectionIndicatorMode;
    
    UIEdgeInsets segmentEdgeInset;
}

@property (nonatomic, assign) NSInteger selectedIndex;
@property (nonatomic, copy) void (^indexChangeBlock)(NSUInteger index); // you can also use addTarget:action:forControlEvents:


- (id)initWithSectionTitles:(NSArray *)sectiontitles;
- (void)setSelectedIndex:(NSUInteger)index animated:(BOOL)animated;

@end
